import { Component, OnInit } from '@angular/core';
import {LoginService } from '../service/login.service';
import { Login } from '../service/login';
@Component({
  selector: 'app-dashboard',
  templateUrl: './dashboard.component.html',
  styleUrls: ['./dashboard.component.less']
})
export class DashboardComponent implements OnInit {
	selectedLogin : Login;
	logins : Login [];
  	constructor(private loginService :LoginService) { }

	ngOnInit() {
	  	this.getLogins();
  	}
  	onSelect(login:Login):void{
  		this.selectedLogin = login;
  	}
  	getLogins():void{
  		 this.loginService.getLogins()
  		.subscribe(logins=>this.logins= logins);
  	}

}
